Skip to content

fix(server): Claude wake turns no longer strand new sessions - #170

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
fix/claude-wake-fresh-session
Nov 20, 2026
Merged

ScriptedAlchemy merged 2 commits into
mainfrom
fix/claude-wake-fresh-session

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Why

Switching a thread back to Claude could fail with "Claude Code could not find this conversation to resume." When a background wake turn landed on a new Claude session, it sent Claude no prompt, so Claude never saved the conversation. T3 still counted the turn, and the next Claude turn resumed a conversation that did not exist. The thread history handed to that session was lost with it.

Real data showed this three times on one thread. Each failing resume pointed at a session created by a 1 to 5 second wake run with no output. No transcript existed for any of them.

What changed

  • A Claude wake turn that would start a new session now runs as a prompted turn, so its text and any handoff history reach Claude.
  • shouldResumeNativeSession decides whether a session exists. Query open uses it to pick resume and turn start uses it for this check, so the two cannot disagree.
  • A wake on a live or resumed session still only replays buffered output.

Blast Radius

Claude adapter only. A wake that starts a new session is now a billed Claude turn. Before this change it was a silent no-op that broke the next turn.

Verification

  • The new test row fails on main (expected [] to have a length of 1 but got +0) and passes with the fix. The test commit lands before the fix.
  • ClaudeAdapterV2.test.ts: 470 passed.
  • vp run check:changed: format, lint, knip, typecheck and tests pass.
  • Not reproduced live. It needs a real background wake to land right after a provider switch.

Opus 5.5 (Claude Code in T3 Code), fix implemented by gpt-6.2-sol (Codex).

🤖 Generated with Claude Code

ScriptedAlchemy and others added 2 commits November 19, 2026 17:23
A continuation turn that starts a new Claude session has nothing to drain.
This case fails on main: Claude receives no prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A background wake that landed on a new Claude session sent no prompt, so
Claude never saved the conversation. T3 still counted the turn, so the
next switch to Claude resumed a missing conversation and failed with
"could not find this conversation". The handoff history inlined into the
wake was lost too.

A wake that would start a new session now runs as a prompted turn. Resume
and this check share one predicate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7c022f4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy merged commit 482df7d into main Nov 20, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant